#!/bin/sh
#file-name=svn.sh

cd /home/cuizheng
#LOG=/home/cuizheng/log/nbd_perf_svn_`date +"%Y-%m-%d=%H:%M:%S"`.log
LOG=/home/cuizheng/log/svn.log


cd /home/cuizheng/file1
rm -rf *
sync
cp /root/code ./ -r
sync
rm -rf /home/cuizheng/file2/*
sync


i=1

while [ $i -le 10 ];
do

START=`date +"%s"`
mv /home/cuizheng/file1/* /home/cuizheng/file2/
sync
END=`date +"%s"` 
echo "
mv /home/cuizheng/file1/* /home/cuizheng/file2/
sync
START:$START,END:$END,SPEND:$((END-START))

" >>$LOG

START=`date +"%s"`
mv /home/cuizheng/file2/* /home/cuizheng/file1/
sync
END=`date +"%s"`
echo "
mv /home/cuizheng/file2/* /home/cuizheng/file1/
sync
START:$START,END:$END,SPEND:$((END-START))

" >> $LOG

i=$(($i + 1))
done

exit 1
